package cic;

import java.awt.Point;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.swing.JFrame;
import javax.swing.JTextArea;

public class InforMonitor {

	private JFrame frame;
	private JTextArea text;
	
	public InforMonitor() {
		
		frame = new JFrame("Information Monitor");
		text = new JTextArea(25, 40);
		
		frame.addWindowListener(new WindowAdapter() {
			public void windowClosing(WindowEvent arg0) {
				System.exit(1);
			}
		});
		
		text.setEditable(false);
		frame.add(text);
		frame.pack();
		Point pt = new Point(200, 200);
		frame.setLocation(pt);
		frame.setVisible(true);
				
	}
	
	public void addInfor(String event) throws Exception {
		
		text.append(event + "\n");		
		Thread.sleep(1000);
		
	}

}
